#define _CRT_SECURE_NO_WARNINGS 1
#include "DList.h"

void test1()
{
	////初始化
	//DListNode* plist = NULL;
	//DLinit(&plist);
	////尾插
	//DLPushBack(plist, 1);
	//DLPushBack(plist, 2);
	//DLPushBack(plist, 3);
	//DLPrint(plist);
	////头插
	//DLPushFront(plist, 4);
	//DLPrint(plist);
	////尾删
	//DLPopBack(plist);
	//DLPrint(plist);
	////头删
	//DLPopFront(plist);
	//DLPrint(plist);
}

void test2()
{
	//初始化
	DListNode* plist = NULL;
	DLinit(&plist);
	//尾插
	DLPushBack(plist, 1);
	DLPushBack(plist, 2);
	DLPushBack(plist, 3);
	DLPrint(plist);
	//查找
	//DListNode* find = DLFind(plist, 2);
	//在pos位置之后插入数据
	//DLInsert(find, 5);
	//DLPrint(plist);
	//删除pos的数据
	//DLPop(find);
	//find = NULL;		//一定要手动给find置空
	//DLPrint(plist);
}

void test3()
{
	//初始化
	DListNode* plist = NULL;
	DLinit(&plist);
	//尾插
	DLPushBack(plist, 1);
	DLPushBack(plist, 2);
	DLPushBack(plist, 3);
	DLPrint(plist);
	//销毁
	DLDestroy(plist);
	plist = NULL;	//一定要手动给plist置空
}

int main()
{
	test3();
	return 0;
}
